<?php


$errorInfo = array();

if($_POST) {

	$db = DB::getInstance();

	$group = Request::post("group_name");
	$memo = Request::post("memo");

	if($group != '' && $memo != '') {
		try {
			$res = $db->query("insert into gc_group (name, memo, status, create_time) values(?,?,?,?)",
				array($group, $memo, C::ST_OK, date("Y-m-d H:i:s")));
			Response::redirect("/?module=group&action=index");
		} catch (Exception $e) {
			$errorInfo[] = $e->getMessage();	
		}
	} else {
		$errorInfo[] = "group or memo cann't be empty";
	}

}

return array();
